package org.wu.framework.authorization.platform.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.wu.framework.web.spring.EasyController;
import org.springframework.web.bind.annotation.*;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.springframework.beans.factory.annotation.Autowired;
import jakarta.annotation.Resource;
import org.wu.framework.authorization.platform.domain.model.lazy.zone.application.version.LazyZoneApplicationVersion;
import org.wu.framework.authorization.platform.application.command.lazy.zone.application.version.LazyZoneApplicationVersionRemoveCommand;
import org.wu.framework.authorization.platform.application.command.lazy.zone.application.version.LazyZoneApplicationVersionStoryCommand;
import org.wu.framework.authorization.platform.application.command.lazy.zone.application.version.LazyZoneApplicationVersionUpdateCommand;
import org.wu.framework.authorization.platform.application.command.lazy.zone.application.version.LazyZoneApplicationVersionQueryListCommand;
import org.wu.framework.authorization.platform.application.command.lazy.zone.application.version.LazyZoneApplicationVersionQueryOneCommand;
import org.wu.framework.authorization.platform.application.LazyZoneApplicationVersionApplication;
import org.wu.framework.authorization.platform.application.dto.LazyZoneApplicationVersionDTO;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
 * describe 应用版本 
 *
 * @author Jia wei Wu
 * @date 2024/04/02 06:21 晚上
 * @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyController 
 **/
@Tag(name = "应用版本提供者")
@EasyController("/lazy/zone/application/version")
public class LazyZoneApplicationVersionProvider  {

    @Resource
    private LazyZoneApplicationVersionApplication lazyZoneApplicationVersionApplication;

    /**
     * describe 新增应用版本
     *
     * @param lazyZoneApplicationVersionStoryCommand 新增应用版本     
     * @return {@link Result<LazyZoneApplicationVersion>} 应用版本新增后领域对象     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "新增应用版本")
    @PostMapping("/story")
    public Result<LazyZoneApplicationVersion> story(@RequestBody LazyZoneApplicationVersionStoryCommand lazyZoneApplicationVersionStoryCommand){
        return lazyZoneApplicationVersionApplication.story(lazyZoneApplicationVersionStoryCommand);
    }
    /**
     * describe 批量新增应用版本
     *
     * @param lazyZoneApplicationVersionStoryCommandList 批量新增应用版本     
     * @return {@link Result<List<LazyZoneApplicationVersion>>} 应用版本新增后领域对象集合     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "批量新增应用版本")
    @PostMapping("/batchStory")
    public Result<List<LazyZoneApplicationVersion>> batchStory(@RequestBody List<LazyZoneApplicationVersionStoryCommand> lazyZoneApplicationVersionStoryCommandList){
        return lazyZoneApplicationVersionApplication.batchStory(lazyZoneApplicationVersionStoryCommandList);
    }
    /**
     * describe 更新应用版本
     *
     * @param lazyZoneApplicationVersionUpdateCommand 更新应用版本     
     * @return {@link Result<LazyZoneApplicationVersion>} 应用版本领域对象     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "更新应用版本")
    @PutMapping("/updateOne")
    public Result<LazyZoneApplicationVersion> updateOne(@RequestBody LazyZoneApplicationVersionUpdateCommand lazyZoneApplicationVersionUpdateCommand){
        return lazyZoneApplicationVersionApplication.updateOne(lazyZoneApplicationVersionUpdateCommand);
    }
    /**
     * describe 查询单个应用版本
     *
     * @param lazyZoneApplicationVersionQueryOneCommand 查询单个应用版本     
     * @return {@link Result<LazyZoneApplicationVersionDTO>} 应用版本DTO对象     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "查询单个应用版本")
    @GetMapping("/findOne")
    public Result<LazyZoneApplicationVersionDTO> findOne(@ModelAttribute LazyZoneApplicationVersionQueryOneCommand lazyZoneApplicationVersionQueryOneCommand){
        return lazyZoneApplicationVersionApplication.findOne(lazyZoneApplicationVersionQueryOneCommand);
    }
    /**
     * describe 查询多个应用版本
     *
     * @param lazyZoneApplicationVersionQueryListCommand 查询多个应用版本     
     * @return {@link Result<List<LazyZoneApplicationVersionDTO>>} 应用版本DTO对象     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "查询多个应用版本")
    @GetMapping("/findList")
    public Result<List<LazyZoneApplicationVersionDTO>> findList(@ModelAttribute LazyZoneApplicationVersionQueryListCommand lazyZoneApplicationVersionQueryListCommand){
        return lazyZoneApplicationVersionApplication.findList(lazyZoneApplicationVersionQueryListCommand);
    }
    /**
     * describe 分页查询多个应用版本
     *
     * @param lazyZoneApplicationVersionQueryListCommand 分页查询多个应用版本     
     * @return {@link Result<LazyPage<LazyZoneApplicationVersionDTO>>} 分页应用版本DTO对象     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "分页查询多个应用版本")
    @GetMapping("/findPage")
    public Result<LazyPage<LazyZoneApplicationVersionDTO>> findPage(@Parameter(description ="分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
                           @Parameter(description ="当前页数") @RequestParam(defaultValue = "1", value = "current") int current,@ModelAttribute LazyZoneApplicationVersionQueryListCommand lazyZoneApplicationVersionQueryListCommand){
        return lazyZoneApplicationVersionApplication.findPage(size,current,lazyZoneApplicationVersionQueryListCommand);
    }
    /**
     * describe 删除应用版本
     *
     * @param lazyZoneApplicationVersionRemoveCommand 删除应用版本     
     * @return {@link Result<LazyZoneApplicationVersion>} 应用版本     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "删除应用版本")
    @DeleteMapping("/remove")
    public Result<LazyZoneApplicationVersion> remove(@ModelAttribute LazyZoneApplicationVersionRemoveCommand lazyZoneApplicationVersionRemoveCommand){
        return lazyZoneApplicationVersionApplication.remove(lazyZoneApplicationVersionRemoveCommand);
    }
}